<template>
	<view class="page  box-sizing ">
		<image src="http://bbsf.oss-cn-shanghai.aliyuncs.com/english/icons/qidong.png" mode=""></image>
	</view>
</template>

<script setup>
	import {
		ref,
		inject
	} from 'vue'
	import {
		onLoad,
	} from '@dcloudio/uni-app'
	const getConfigSetApi = inject('getConfigSet')

	onLoad(() => {
		wx.login({
			success(res) {
				console.log(res, 134)
				// return
				getConfigSetApi({
					code: res.code
				}).then(es => {
					console.log(es)
					// loading.value=false
					console.log(es.user,2666666)
					// uni.redirectTo({
					// 	url: '/pages/index/index'
					// })
					setTimeout(() => {
						if (es.user && es.user.user_id) {
							uni.setStorageSync('userInfo', es.user)
							uni.setStorageSync('token', es.token)
							uni.redirectTo({
								url: '/pages/index/index'
							})
						}else{
							uni.redirectTo({
								url: '/pages/login/login'
							})
						}
					}, 3000)
				
				

				})
			}
		})


	});

</script>

<style lang="scss" scoped>
.page{
	width: 100%;
	height: 100vh;
	image{
		width: 100%;
		height: 100vh;
	}
}
</style>